import request from '@/utils/request'
const base = '/system/user/profile'




// 查询用户个人信息
export function getUserProfile() {
    return request({
        url: `${base}`,
        method: 'get'
    })
}

//获取已绑定三方用户
export function getUserBinds() {
    return request({
        url: `${base}/binds`,
        method: 'get'
    })
}

//解绑
export function unbindUser(bindId) {
    return request({
        url: `${base}/unbind`,
        params: { bindId },
        method: 'delete',
    })
}

//绑定账号
export function bindUser(data) {
    return request({
        url: `${base}/bind`,
        data: data,
        method: 'post',
    })
}

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
    const data = {
        oldPassword,
        newPassword
    }
    return request({
        url: '/system/user/profile/password',
        method: 'put',
        data: data
    })
}